﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Notepad_X.Classes {
    public class DocumentsCollection : List<IDocument>{
        public DocumentsCollection() { }

        public IDocument this[int index] {
            get { return base[index]; }
            set { base[index] = value; }
        }

        ~DocumentsCollection() {
            base.Clear();
        }

        /// <summary>
        /// Add document to the collection
        /// </summary>
        /// <param name="doc">The document</param>
        /// <returns>Returns the index id</returns>
        public  int Add(IDocument doc) {
            base.Add(doc);
            return base.Count-1;
        }
    }
}
